# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidManagement.V1.Model.Device do
  @moduledoc """
  A device owned by an enterprise. Unless otherwise noted, all fields are read-only and can't be modified by enterprises.devices.patch.

  ## Attributes

  *   `deviceSettings` (*type:* `GoogleApi.AndroidManagement.V1.Model.DeviceSettings.t`, *default:* `nil`) - Device settings information. This information is only available if deviceSettingsEnabled is true in the device's policy.
  *   `networkInfo` (*type:* `GoogleApi.AndroidManagement.V1.Model.NetworkInfo.t`, *default:* `nil`) - Device network information. This information is only available if networkInfoEnabled is true in the device's policy.
  *   `state` (*type:* `String.t`, *default:* `nil`) - The state to be applied to the device. This field can be modified by a patch request. Note that when calling enterprises.devices.patch, ACTIVE and DISABLED are the only allowable values. To enter the device into a DELETED state, call enterprises.devices.delete.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}.
  *   `enrollmentTime` (*type:* `DateTime.t`, *default:* `nil`) - The time of device enrollment.
  *   `policyName` (*type:* `String.t`, *default:* `nil`) - The name of the policy applied to the device, in the form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the policy_name for the device's user is applied. This field can be modified by a patch request. You can specify only the policyId when calling enterprises.devices.patch, as long as the policyId doesn’t contain any slashes. The rest of the policy name is inferred.
  *   `userName` (*type:* `String.t`, *default:* `nil`) - The resource name of the user that owns this device in the form enterprises/{enterpriseId}/users/{userId}.
  *   `lastPolicyComplianceReportTime` (*type:* `DateTime.t`, *default:* `nil`) - Deprecated.
  *   `policyCompliant` (*type:* `boolean()`, *default:* `nil`) - Whether the device is compliant with its policy.
  *   `managementMode` (*type:* `String.t`, *default:* `nil`) - The type of management mode Android Device Policy takes on the device. This influences which policy settings are supported.
  *   `lastPolicySyncTime` (*type:* `DateTime.t`, *default:* `nil`) - The last time the device fetched its policy.
  *   `applicationReports` (*type:* `list(GoogleApi.AndroidManagement.V1.Model.ApplicationReport.t)`, *default:* `nil`) - Reports for apps installed on the device. This information is only available when application_reports_enabled is true in the device's policy.
  *   `systemProperties` (*type:* `map()`, *default:* `nil`) - Map of selected system properties name and value related to the device. This information is only available if systemPropertiesEnabled is true in the device's policy.
  *   `apiLevel` (*type:* `integer()`, *default:* `nil`) - The API level of the Android platform version running on the device.
  *   `appliedPasswordPolicies` (*type:* `list(GoogleApi.AndroidManagement.V1.Model.PasswordRequirements.t)`, *default:* `nil`) - The password requirements currently applied to the device. The applied requirements may be slightly different from those specified in passwordPolicies in some cases. fieldPath is set based on passwordPolicies.
  *   `appliedPolicyName` (*type:* `String.t`, *default:* `nil`) - The name of the policy currently applied to the device.
  *   `previousDeviceNames` (*type:* `list(String.t)`, *default:* `nil`) - If the same physical device has been enrolled multiple times, this field contains its previous device names. The serial number is used as the unique identifier to determine if the same physical device has enrolled previously. The names are in chronological order.
  *   `securityPosture` (*type:* `GoogleApi.AndroidManagement.V1.Model.SecurityPosture.t`, *default:* `nil`) - Device's security posture value that reflects how secure the device is.
  *   `enrollmentTokenName` (*type:* `String.t`, *default:* `nil`) - If the device was enrolled with an enrollment token, this field contains the name of the token.
  *   `enrollmentTokenData` (*type:* `String.t`, *default:* `nil`) - If the device was enrolled with an enrollment token with additional data provided, this field contains that data.
  *   `hardwareStatusSamples` (*type:* `list(GoogleApi.AndroidManagement.V1.Model.HardwareStatus.t)`, *default:* `nil`) - Hardware status samples in chronological order. This information is only available if hardwareStatusEnabled is true in the device's policy.
  *   `nonComplianceDetails` (*type:* `list(GoogleApi.AndroidManagement.V1.Model.NonComplianceDetail.t)`, *default:* `nil`) - Details about policy settings that the device is not compliant with.
  *   `lastStatusReportTime` (*type:* `DateTime.t`, *default:* `nil`) - The last time the device sent a status report.
  *   `hardwareInfo` (*type:* `GoogleApi.AndroidManagement.V1.Model.HardwareInfo.t`, *default:* `nil`) - Detailed information about the device hardware.
  *   `memoryEvents` (*type:* `list(GoogleApi.AndroidManagement.V1.Model.MemoryEvent.t)`, *default:* `nil`) - Events related to memory and storage measurements in chronological order. This information is only available if memoryInfoEnabled is true in the device's policy.Events are retained for a certain period of time and old events are deleted.
  *   `commonCriteriaModeInfo` (*type:* `GoogleApi.AndroidManagement.V1.Model.CommonCriteriaModeInfo.t`, *default:* `nil`) - Information about Common Criteria Mode—security standards defined in the Common Criteria for Information Technology Security Evaluation (https://www.commoncriteriaportal.org/) (CC).This information is only available if statusReportingSettings.commonCriteriaModeEnabled is true in the device's policy the device is company-owned.
  *   `ownership` (*type:* `String.t`, *default:* `nil`) - Ownership of the managed device.
  *   `powerManagementEvents` (*type:* `list(GoogleApi.AndroidManagement.V1.Model.PowerManagementEvent.t)`, *default:* `nil`) - Power management events on the device in chronological order. This information is only available if powerManagementEventsEnabled is true in the device's policy.
  *   `appliedPolicyVersion` (*type:* `String.t`, *default:* `nil`) - The version of the policy currently applied to the device.
  *   `appliedState` (*type:* `String.t`, *default:* `nil`) - The state currently applied to the device.
  *   `user` (*type:* `GoogleApi.AndroidManagement.V1.Model.User.t`, *default:* `nil`) - The user who owns the device.
  *   `dpcMigrationInfo` (*type:* `GoogleApi.AndroidManagement.V1.Model.DpcMigrationInfo.t`, *default:* `nil`) - Output only. Information related to whether this device was migrated from being managed by another Device Policy Controller (DPC).
  *   `displays` (*type:* `list(GoogleApi.AndroidManagement.V1.Model.Display.t)`, *default:* `nil`) - Detailed information about displays on the device. This information is only available if displayInfoEnabled is true in the device's policy.
  *   `disabledReason` (*type:* `GoogleApi.AndroidManagement.V1.Model.UserFacingMessage.t`, *default:* `nil`) - If the device state is DISABLED, an optional message that is displayed on the device indicating the reason the device is disabled. This field can be modified by a patch request.
  *   `softwareInfo` (*type:* `GoogleApi.AndroidManagement.V1.Model.SoftwareInfo.t`, *default:* `nil`) - Detailed information about the device software. This information is only available if softwareInfoEnabled is true in the device's policy.
  *   `memoryInfo` (*type:* `GoogleApi.AndroidManagement.V1.Model.MemoryInfo.t`, *default:* `nil`) - Memory information: contains information about device memory and storage.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deviceSettings => GoogleApi.AndroidManagement.V1.Model.DeviceSettings.t() | nil,
          :networkInfo => GoogleApi.AndroidManagement.V1.Model.NetworkInfo.t() | nil,
          :state => String.t() | nil,
          :name => String.t() | nil,
          :enrollmentTime => DateTime.t() | nil,
          :policyName => String.t() | nil,
          :userName => String.t() | nil,
          :lastPolicyComplianceReportTime => DateTime.t() | nil,
          :policyCompliant => boolean() | nil,
          :managementMode => String.t() | nil,
          :lastPolicySyncTime => DateTime.t() | nil,
          :applicationReports =>
            list(GoogleApi.AndroidManagement.V1.Model.ApplicationReport.t()) | nil,
          :systemProperties => map() | nil,
          :apiLevel => integer() | nil,
          :appliedPasswordPolicies =>
            list(GoogleApi.AndroidManagement.V1.Model.PasswordRequirements.t()) | nil,
          :appliedPolicyName => String.t() | nil,
          :previousDeviceNames => list(String.t()) | nil,
          :securityPosture => GoogleApi.AndroidManagement.V1.Model.SecurityPosture.t() | nil,
          :enrollmentTokenName => String.t() | nil,
          :enrollmentTokenData => String.t() | nil,
          :hardwareStatusSamples =>
            list(GoogleApi.AndroidManagement.V1.Model.HardwareStatus.t()) | nil,
          :nonComplianceDetails =>
            list(GoogleApi.AndroidManagement.V1.Model.NonComplianceDetail.t()) | nil,
          :lastStatusReportTime => DateTime.t() | nil,
          :hardwareInfo => GoogleApi.AndroidManagement.V1.Model.HardwareInfo.t() | nil,
          :memoryEvents => list(GoogleApi.AndroidManagement.V1.Model.MemoryEvent.t()) | nil,
          :commonCriteriaModeInfo =>
            GoogleApi.AndroidManagement.V1.Model.CommonCriteriaModeInfo.t() | nil,
          :ownership => String.t() | nil,
          :powerManagementEvents =>
            list(GoogleApi.AndroidManagement.V1.Model.PowerManagementEvent.t()) | nil,
          :appliedPolicyVersion => String.t() | nil,
          :appliedState => String.t() | nil,
          :user => GoogleApi.AndroidManagement.V1.Model.User.t() | nil,
          :dpcMigrationInfo => GoogleApi.AndroidManagement.V1.Model.DpcMigrationInfo.t() | nil,
          :displays => list(GoogleApi.AndroidManagement.V1.Model.Display.t()) | nil,
          :disabledReason => GoogleApi.AndroidManagement.V1.Model.UserFacingMessage.t() | nil,
          :softwareInfo => GoogleApi.AndroidManagement.V1.Model.SoftwareInfo.t() | nil,
          :memoryInfo => GoogleApi.AndroidManagement.V1.Model.MemoryInfo.t() | nil
        }

  field(:deviceSettings, as: GoogleApi.AndroidManagement.V1.Model.DeviceSettings)
  field(:networkInfo, as: GoogleApi.AndroidManagement.V1.Model.NetworkInfo)
  field(:state)
  field(:name)
  field(:enrollmentTime, as: DateTime)
  field(:policyName)
  field(:userName)
  field(:lastPolicyComplianceReportTime, as: DateTime)
  field(:policyCompliant)
  field(:managementMode)
  field(:lastPolicySyncTime, as: DateTime)

  field(:applicationReports,
    as: GoogleApi.AndroidManagement.V1.Model.ApplicationReport,
    type: :list
  )

  field(:systemProperties, type: :map)
  field(:apiLevel)

  field(:appliedPasswordPolicies,
    as: GoogleApi.AndroidManagement.V1.Model.PasswordRequirements,
    type: :list
  )

  field(:appliedPolicyName)
  field(:previousDeviceNames, type: :list)
  field(:securityPosture, as: GoogleApi.AndroidManagement.V1.Model.SecurityPosture)
  field(:enrollmentTokenName)
  field(:enrollmentTokenData)

  field(:hardwareStatusSamples,
    as: GoogleApi.AndroidManagement.V1.Model.HardwareStatus,
    type: :list
  )

  field(:nonComplianceDetails,
    as: GoogleApi.AndroidManagement.V1.Model.NonComplianceDetail,
    type: :list
  )

  field(:lastStatusReportTime, as: DateTime)
  field(:hardwareInfo, as: GoogleApi.AndroidManagement.V1.Model.HardwareInfo)
  field(:memoryEvents, as: GoogleApi.AndroidManagement.V1.Model.MemoryEvent, type: :list)
  field(:commonCriteriaModeInfo, as: GoogleApi.AndroidManagement.V1.Model.CommonCriteriaModeInfo)
  field(:ownership)

  field(:powerManagementEvents,
    as: GoogleApi.AndroidManagement.V1.Model.PowerManagementEvent,
    type: :list
  )

  field(:appliedPolicyVersion)
  field(:appliedState)
  field(:user, as: GoogleApi.AndroidManagement.V1.Model.User)
  field(:dpcMigrationInfo, as: GoogleApi.AndroidManagement.V1.Model.DpcMigrationInfo)
  field(:displays, as: GoogleApi.AndroidManagement.V1.Model.Display, type: :list)
  field(:disabledReason, as: GoogleApi.AndroidManagement.V1.Model.UserFacingMessage)
  field(:softwareInfo, as: GoogleApi.AndroidManagement.V1.Model.SoftwareInfo)
  field(:memoryInfo, as: GoogleApi.AndroidManagement.V1.Model.MemoryInfo)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidManagement.V1.Model.Device do
  def decode(value, options) do
    GoogleApi.AndroidManagement.V1.Model.Device.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidManagement.V1.Model.Device do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
